<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:cc="http://java.sun.com/jsf/composite"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<cc:interface>
	<cc:attribute name="colunas" />
	<cc:attribute name="modelo" />
	<cc:editableValueHolder name="inputs" targets="marca descricao"/>
	<cc:attribute name="labelBotao" default="Salvar" />
	<cc:attribute name="acao" method-signature="java.lang.String action(br.com.casadocodigo.jsfjpa.entities.Modelo)"/>
</cc:interface>

<cc:implementation>

	<h:form id="formModelo" prependId="false">
			<h:panelGrid columns="#{cc.attrs.colunas}">
				Marca: <h:selectOneMenu id="marca" label="marca" value="#{cc.attrs.modelo.marca}" converter="entityConverter">
							<f:selectItem itemLabel="-- Selecione --" noSelectionOption="true"/>
							<f:selectItems value="#{marcaBean.marcas}" var="marca" itemValue="#{marca}" itemLabel="#{marca.nome}"/>
						</h:selectOneMenu>
				Descricao: <h:inputText id="descricao" label="descição" value="#{cc.attrs.modelo.descricao}"/>

			<h:commandButton value="#{cc.attrs.labelBotao}" action="#{cc.attrs.acao}"/>
			</h:panelGrid>
			
		</h:form>
</cc:implementation>
</html>
